package day1104.demo03;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collection;
import java.util.Collections;
import java.util.stream.Stream;

/**
 * @program: qy158
 * @description:
 * @author: 闫克起2
 * @create: 2022-11-04 10:46
 **/
public class Test02 {
    public static void main(String[] args) {
        ArrayList<String> list = new ArrayList<>();
        Collections.addAll(list, "张无忌", "周芷若", "赵敏", "张强", "张三丰");
        //通过集合对象调用stream方法获取
        Stream<String> stream = list.stream();

        //通过Arrays数组工具类调用stream方法。
        String [] arr={"张三","李四","王五"};
        Stream<String> stream1 = Arrays.stream(arr);

        //通过Stream类中的方法获取Stream流对象
        Stream<String> stream2 = Stream.of("张三", "李四", "王五");
    }
}
